/**
 *  node是基于事件回调的，内部自己实现一个发布订阅模式
 *  内置模块：events
 *
 */
const EventEmitter = require('./events.js');
// const myEmitter = new EventEmitter();

class MyEmitter extends EventEmitter {}

const myEmitter = new MyEmitter();
myEmitter.on('event', () => {
  console.log('触发事件');
});
myEmitter.emit('event');
